const { contextBridge, ipcRenderer } = require('electron');

contextBridge.exposeInMainWorld('videoDownloader', {
  // 关键修复：将参数封装为对象进行传递，防止丢失
  download: (url, platform) => ipcRenderer.invoke('download-video', { url, platform }), 
  onProgress: (callback) => ipcRenderer.on('download-progress', (event, data) => callback(data))
});